
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>

#ifndef REQ_H
#define	REQ_H

#define PORTA 9090

typedef struct sockaddr_in sockaddr_in;
typedef struct sockaddr sockaddr;
typedef struct hostent hostent;
typedef struct in_addr in_addr;

int conectar(int sockfd, sockaddr_in *their_addr);
int receber(int sock, char *buf, int size);
int enviar(int sockfd, char *package);
int prepararHost(int *sockfd, sockaddr_in *their_addr, hostent *he, int port, char *hostname);
int preparar(int *sockfd, sockaddr_in *their_addr, hostent *he, int port);



#endif	/* REQ_H */

